<!DOCTYPE html>
<html>
  <head>
    <title> IconBarTester </title>
    <script type="text/javascript" src="../testdata/sgfs.js"></script>

    <!-- AUTO-GEN-DEPS -->
    <!-- END-AUTO-GEN-DEPS -->
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      #wrap {
        width: 100%;
        height: 100%;
      }
      #glift_display_bar {
        position:absolute;
        background-color: cyan;
        bottom: 0;
        height: 100;
        left: 200;
        right: 100;
      }
      #glift_display_base {
        position:absolute;
        background-color: #FFEEEE;
        bottom: 0;
        height: 400;
        left: 100;
        right: 100;
      }
    </style>
  </head>

  <body>
    <div id="wrap" style="position:relative;">
      <div id="gheader"></div>
      <div id="glift_display_base">
        <div id="glift_display_bar"></div>
      </div>
      <div id="extra_info"></div>
      <script type="text/javascript">
        var point = glift.util.point;
        var iconBar = glift.displays.icons.bar({
            divId: 'glift_display_bar',
            vertMargin:  5,
            icons:  ['chevron-left', 'refresh', 'chevron-right',
                'roadmap', 'small-gear', 'multiopen-boxonly',
                ['question-bubble', 'undo', 'twostones', 'refresh', 'arrowup']]
        });

        iconBar.forEachIcon(function(icon) {
          iconBar.setEvent(icon.iconName, 'mouseover', function() {
            $('#' + icon.elementId).attr('fill', 'red');
          }).setEvent(icon.iconName, 'mouseout', function() {
            $('#' + icon.elementId).attr('fill',
              iconBar.theme.icons.DEFAULT.fill);
          });
        });
        iconBar.setCenteredTempIcon('multiopen-boxonly', 'check', 'blue');

        var multi = iconBar.getIcon(6);
        iconBar.setCenteredTempIcon('multiopen', multi.getActive(), 'black');
        iconBar.setEvent(6, 'click', function(event, icon) {
          var ic = glift.displays.icons.iconSelector('glift_display_base', 'glift_display_bar', icon);
          ic.setIconEvents('click', function(event, wrappedIcon) {
            iconBar.getIcon(6).setActive(wrappedIcon.iconName);
            iconBar.setCenteredTempIcon(6, multi.getActive(), 'blue');
          });
        });
        iconBar.flushEvents();
      </script>
    </div>
  </body>
</html>
